<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
    <!-- Loading Bootstrap -->
    <link href="Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
    <!-- Loading Flat UI -->
    <link href="Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
    <link rel="shortcut icon" href="Public/Admin/Flat/img/favicon.ico">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="dist/js/vendor/html5shiv.js"></script>
    <script src="dist/js/vendor/respond.min.js"></script>
    <![endif]-->

    <!-- 气泡弹窗 -->
    <script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/js/hdjs.css" />
    <script src="{{__PUBLIC__}}/Home/js/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    {{if value="$userData"}}
        <div class="alert alert-success" style="overflow:hidden;">{{$userData['username']}} 管理员的角色信息<a class="btn btn-primary "  style="float:right;" href="{{U('addrole',array('aid'=>Q('get.aid')))}}">添加新的权限角色</a></div>
    {{else}}
        <div class="alert alert-success" style="overflow:hidden;">角色列表<a class="btn btn-primary "  style="float:right;" href="{{U('addrole',array('aid'=>Q('get.aid')))}}">添加新的权限角色</a></div>
    {{endif}}
    <form action="" method="post" onsubmit="return hd_submit(this,'{{U('Rbac/authority')}}','{{U('Rbac/index')}}')">
        <table class="table table-hover">
            <thead>
                <legend>角色信息</legend>
            </thead>
            <tr>
                <th width="30">&nbsp;</th>
                <th width="30">id</th>
                <th width="100">name</th>
                <th width="100">状态</th>
                <th>备注</th>
                <th  width="150">操作</th>
            </tr>
            {{foreach from="$roleData" value="$v"}}
            <tr class="role">
                <td>
                    {{if value="$userData"}}
                        <input type="checkbox"  name="id[]" value="{{$v['id']}}" {{if value="in_array($v['id'],$role_id)"}}checked{{endif}}>
                    {{endif}}
                </td>
                <td class="rid" rid="{{$v['id']}}">{{$v['id']}}</td>
                <td class="name">{{$v['name']}}</td>
                <td>{{$v['status']}}</td>
                <td>{{$v['remark']}}</td>
                <td>
                    <a class="btn btn-primary btn-warning" href="{{U('editrole',array('rid'=>$v['id'],'aid'=>Q('get.aid')))}}">修改</a>
                    <a  href="javascript:if(confirm('确定删除吗？')) location.href='{{U('delrole',array('rid'=>$v['id'],'aid'=>Q('get.aid')))}}';" class="btn btn-primary btn-danger">删除</a>
                </td>
            </tr>
            {{endforeach}}
        </table>
        <input type="hidden" name="aid" value="{{Q('get.aid')}}" />
        {{if value="$userData"}}
            <input type="submit" value="确认权限" class="btn btn-primary btn-block" />
        {{endif}}
    </form>
    
</body>
</html>